<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>角色列表</title>
    <!-- 静态包含,静态包含会把jsp合并过来形成一个整个servlet输出. 动态会多个sevlet的结果合并 -->
    <%@include file="common/head.jsp" %>
    <!-- 引入jstl -->
    <%@include file="common/taglib.jsp" %>
    <!-- 项目公共 JavaScript 文件 -->
    <script src="/resources/js/common/common.js"></script>
    <script src="/resources/js/common/pageHandler.js"></script>
    <script src="/resources/js/role.js"></script>
</head>
<body>
<!-- 页面显示部分 -->
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="alert fade col-sm-offset-3 col-sm-4 text-center alert-msg" id="alertMsg"></div>
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="searchInput"  value="">
                        <input type="hidden" class="form-control" id="commitInput"  value="">
                        <input type="hidden" class="form-control" id="currentPage"  value="1">
                        <input type="hidden" class="form-control" id="pageNumber"  value="">
                        <input type="hidden" class="form-control" id="totalPage"  value="">
                    </div>
                    <div class="col-sm-9 text-right">
                        <button class="btn btn-default" onclick="zhigong.searchData('role')">查询</button>
                        <button class="btn btn-default" onclick="openModal('new')">新增</button>
                    </div>
                </div>
            </div>

            <div class="panel panel-default data-table" id="dataTable">
                <div class="table-responsive">
                    <table class="table table-hover text-center">
                        <thead>
                        <tr>
                            <th>角色id</th>
                            <th>名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="tbodyList">

                        </tbody>
                    </table>
                </div>
            </div>
            <div class="page col-sm-12 text-right" id="pageWrap">
                <ul class="pagination">
                    <li class="disabled"><a href="javascript:void(0);" onclick="prePage(this)">&laquo;</a></li>
                    <li class="active"><a href="javascript:void(0);" onclick="transPage(this, 'role')">1</a></li>
                    <li><a href="javascript:void(0);" onclick="transPage(this, 'role')">2</a></li>
                    <li><a href="javascript:void(0);" onclick="transPage(this, 'role')">3</a></li>
                    <li><a href="javascript:void(0);" onclick="transPage(this, 'role')">4</a></li>
                    <li><a href="javascript:void(0);" onclick="transPage(this, 'role')">5</a></li>
                    <li><a href="javascript:void(0);" onclick="nextPage(this)" >&raquo;</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>


<!-- 弹出层部分 -->
<div class="modal fade" tabindex="-1" role="dialog" id="dataModal">

    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">角色维护</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="id" class="col-sm-2 col-sm-offset-1 control-label">角色id</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control prikey" id="id" disabled value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="name" class="col-sm-2 col-sm-offset-1 control-label">角色名称</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="name" value="" placeholder="请输入角色名称">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="menuList" class="col-sm-5 control-label" style="text-align:center;">菜单列表</label>
                        <label for="selectedMenu" class="col-sm-5 col-sm-offset-2 control-label" style="text-align:center;">已选菜单</label>
                        <div class="col-sm-5">
                            <select class="form-control" multiple  id="menuList" >

                            </select>
                        </div>
                        <div class="col-sm-2 text-center">
                            <a herf="javascript:void(0)" class="btn btn-default btn-block" onclick="toMenuList()"><<</a>
                            <a herf="javascript:void(0)" class="btn btn-default btn-block" onclick="toselectedMenu()">>></a>
                        </div>
                        <div class="col-sm-5">
                            <select class="form-control" multiple  id="selectedMenu" >

                            </select>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="saveBtn" onclick="saveRoleData()">保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 删除时弹出 -->
<input type="hidden" id="common_confirm_btn" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#common_confirm_model">
<div id="common_confirm_model" class="modal">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h5 class="modal-title"><i class="fa fa-exclamation-circle"></i> <span class="title"></span></h5>
            </div>
            <div class="modal-body small">
                <p ><span class="message"></span></p>
            </div>
            <div class="modal-footer" >
                <button type="button" class="btn btn-primary ok" data-dismiss="modal">确认</button>
                <button type="button" class="btn btn-default cancel" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>


</body>
</html>